Integrand size = 23, antiderivative size = 248 \[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=-\frac {\left (4 a^2-3 b^2\right ) E\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (c+d x)}}{6 \left (a^2-b^2\right ) d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {2 a \operatorname {EllipticF}\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right ),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{3 d \sqrt {a+b \sin (c+d x)}}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{6 \left (a^2-b^2\right ) d}+\frac {\sec ^2(c+d x) \sqrt {a+b \sin (c+d x)} \tan (c+d x)}{3 d} \]
-1/6*sec(d*x+c)*(a*b-(4*a^2-3*b^2)*sin(d*x+c))*(a+b*sin(d*x+c))^(1/2)/(a^2 -b^2)/d+1/6*(4*a^2-3*b^2)*(sin(1/2*c+1/4*Pi+1/2*d*x)^2)^(1/2)/sin(1/2*c+1/ 4*Pi+1/2*d*x)*EllipticE(cos(1/2*c+1/4*Pi+1/2*d*x),2^(1/2)*(b/(a+b))^(1/2)) *(a+b*sin(d*x+c))^(1/2)/(a^2-b^2)/d/((a+b*sin(d*x+c))/(a+b))^(1/2)-2/3*a*( sin(1/2*c+1/4*Pi+1/2*d*x)^2)^(1/2)/sin(1/2*c+1/4*Pi+1/2*d*x)*EllipticF(cos (1/2*c+1/4*Pi+1/2*d*x),2^(1/2)*(b/(a+b))^(1/2))*((a+b*sin(d*x+c))/(a+b))^( 1/2)/d/(a+b*sin(d*x+c))^(1/2)+1/3*sec(d*x+c)^2*(a+b*sin(d*x+c))^(1/2)*tan( d*x+c)/d
Time = 2.26 (sec) , antiderivative size = 270, normalized size of antiderivative = 1.09 \[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\frac {\left (4 a^3+4 a^2 b-3 a b^2-3 b^3\right ) E\left (\frac {1}{4} (-2 c+\pi -2 d x)|\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}-4 a \left (a^2-b^2\right ) \operatorname {EllipticF}\left (\frac {1}{4} (-2 c+\pi -2 d x),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}+\frac {1}{8} \sec ^3(c+d x) \left (8 a^2 b-11 b^3+\left (-12 a^2 b+8 b^3\right ) \cos (2 (c+d x))+\left (-4 a^2 b+3 b^3\right ) \cos (4 (c+d x))+24 a^3 \sin (c+d x)-24 a b^2 \sin (c+d x)+8 a^3 \sin (3 (c+d x))-8 a b^2 \sin (3 (c+d x))\right )}{6 (a-b) (a+b) d \sqrt {a+b \sin (c+d x)}} \]
((4*a^3 + 4*a^2*b - 3*a*b^2 - 3*b^3)*EllipticE[(-2*c + Pi - 2*d*x)/4, (2*b )/(a + b)]*Sqrt[(a + b*Sin[c + d*x])/(a + b)] - 4*a*(a^2 - b^2)*EllipticF[ (-2*c + Pi - 2*d*x)/4, (2*b)/(a + b)]*Sqrt[(a + b*Sin[c + d*x])/(a + b)] + (Sec[c + d*x]^3*(8*a^2*b - 11*b^3 + (-12*a^2*b + 8*b^3)*Cos[2*(c + d*x)] + (-4*a^2*b + 3*b^3)*Cos[4*(c + d*x)] + 24*a^3*Sin[c + d*x] - 24*a*b^2*Sin [c + d*x] + 8*a^3*Sin[3*(c + d*x)] - 8*a*b^2*Sin[3*(c + d*x)]))/8)/(6*(a - b)*(a + b)*d*Sqrt[a + b*Sin[c + d*x]])
Time = 1.22 (sec) , antiderivative size = 261, normalized size of antiderivative = 1.05, number of steps used = 15, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.652, Rules used = {3042, 3169, 27, 3042, 3345, 27, 3042, 3231, 3042, 3134, 3042, 3132, 3142, 3042, 3140}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sqrt {a+b \sin (c+d x)}}{\cos (c+d x)^4}dx\) |
\(\Big \downarrow \) 3169 |
\(\displaystyle \frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}-\frac {1}{3} \int -\frac {\sec ^2(c+d x) (4 a+3 b \sin (c+d x))}{2 \sqrt {a+b \sin (c+d x)}}dx\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{6} \int \frac {\sec ^2(c+d x) (4 a+3 b \sin (c+d x))}{\sqrt {a+b \sin (c+d x)}}dx+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{6} \int \frac {4 a+3 b \sin (c+d x)}{\cos (c+d x)^2 \sqrt {a+b \sin (c+d x)}}dx+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3345 |
\(\displaystyle \frac {1}{6} \left (-\frac {\int \frac {a b^2+\left (4 a^2-3 b^2\right ) \sin (c+d x) b}{2 \sqrt {a+b \sin (c+d x)}}dx}{a^2-b^2}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{6} \left (-\frac {\int \frac {a b^2+\left (4 a^2-3 b^2\right ) \sin (c+d x) b}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{6} \left (-\frac {\int \frac {a b^2+\left (4 a^2-3 b^2\right ) \sin (c+d x) b}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3231 |
\(\displaystyle \frac {1}{6} \left (-\frac {\left (4 a^2-3 b^2\right ) \int \sqrt {a+b \sin (c+d x)}dx-4 a \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{6} \left (-\frac {\left (4 a^2-3 b^2\right ) \int \sqrt {a+b \sin (c+d x)}dx-4 a \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3134 |
\(\displaystyle \frac {1}{6} \left (-\frac {\frac {\left (4 a^2-3 b^2\right ) \sqrt {a+b \sin (c+d x)} \int \sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}dx}{\sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-4 a \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{6} \left (-\frac {\frac {\left (4 a^2-3 b^2\right ) \sqrt {a+b \sin (c+d x)} \int \sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}dx}{\sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-4 a \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3132 |
\(\displaystyle \frac {1}{6} \left (-\frac {\frac {2 \left (4 a^2-3 b^2\right ) \sqrt {a+b \sin (c+d x)} E\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-4 a \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}}dx}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3142 |
\(\displaystyle \frac {1}{6} \left (-\frac {\frac {2 \left (4 a^2-3 b^2\right ) \sqrt {a+b \sin (c+d x)} E\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-\frac {4 a \left (a^2-b^2\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}} \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}}dx}{\sqrt {a+b \sin (c+d x)}}}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{6} \left (-\frac {\frac {2 \left (4 a^2-3 b^2\right ) \sqrt {a+b \sin (c+d x)} E\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-\frac {4 a \left (a^2-b^2\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}} \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}}dx}{\sqrt {a+b \sin (c+d x)}}}{2 \left (a^2-b^2\right )}-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3140 |
\(\displaystyle \frac {1}{6} \left (-\frac {\sec (c+d x) \sqrt {a+b \sin (c+d x)} \left (a b-\left (4 a^2-3 b^2\right ) \sin (c+d x)\right )}{d \left (a^2-b^2\right )}-\frac {\frac {2 \left (4 a^2-3 b^2\right ) \sqrt {a+b \sin (c+d x)} E\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-\frac {8 a \left (a^2-b^2\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right ),\frac {2 b}{a+b}\right )}{d \sqrt {a+b \sin (c+d x)}}}{2 \left (a^2-b^2\right )}\right )+\frac {\tan (c+d x) \sec ^2(c+d x) \sqrt {a+b \sin (c+d x)}}{3 d}\) |
(-((Sec[c + d*x]*Sqrt[a + b*Sin[c + d*x]]*(a*b - (4*a^2 - 3*b^2)*Sin[c + d *x]))/((a^2 - b^2)*d)) - ((2*(4*a^2 - 3*b^2)*EllipticE[(c - Pi/2 + d*x)/2, (2*b)/(a + b)]*Sqrt[a + b*Sin[c + d*x]])/(d*Sqrt[(a + b*Sin[c + d*x])/(a + b)]) - (8*a*(a^2 - b^2)*EllipticF[(c - Pi/2 + d*x)/2, (2*b)/(a + b)]*Sqr t[(a + b*Sin[c + d*x])/(a + b)])/(d*Sqrt[a + b*Sin[c + d*x]]))/(2*(a^2 - b ^2)))/6 + (Sec[c + d*x]^2*Sqrt[a + b*Sin[c + d*x]]*Tan[c + d*x])/(3*d)
3.5.82.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[2*(Sqrt[a + b]/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2*(b/(a + b))], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]
Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[Sqrt[a + b*Sin[c + d*x]]/Sqrt[(a + b*Sin[c + d*x])/(a + b)] Int[Sqrt[a/(a + b) + ( b/(a + b))*Sin[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2 , 0] && !GtQ[a + b, 0]
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/(d*S qrt[a + b]))*EllipticF[(1/2)*(c - Pi/2 + d*x), 2*(b/(a + b))], x] /; FreeQ[ {a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[Sqrt[(a + b*Sin[c + d*x])/(a + b)]/Sqrt[a + b*Sin[c + d*x]] Int[1/Sqrt[a/(a + b) + (b/(a + b))*Sin[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && !GtQ[a + b, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_), x_Symbol] :> Simp[(-(g*Cos[e + f*x])^(p + 1))*(a + b*Sin[e + f*x ])^m*(Sin[e + f*x]/(f*g*(p + 1))), x] + Simp[1/(g^2*(p + 1)) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 1)*(a*(p + 2) + b*(m + p + 2)*Si n[e + f*x]), x], x] /; FreeQ[{a, b, e, f, g}, x] && NeQ[a^2 - b^2, 0] && Lt Q[0, m, 1] && LtQ[p, -1] && (IntegersQ[2*m, 2*p] || IntegerQ[m])
Int[((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*sin[(e_.) + ( f_.)*(x_)]], x_Symbol] :> Simp[(b*c - a*d)/b Int[1/Sqrt[a + b*Sin[e + f*x ]], x], x] + Simp[d/b Int[Sqrt[a + b*Sin[e + f*x]], x], x] /; FreeQ[{a, b , c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(g*Co s[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m + 1)*((b*c - a*d - (a*c - b*d)* Sin[e + f*x])/(f*g*(a^2 - b^2)*(p + 1))), x] + Simp[1/(g^2*(a^2 - b^2)*(p + 1)) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^m*Simp[c*(a^2*(p + 2) - b^2*(m + p + 2)) + a*b*d*m + b*(a*c - b*d)*(m + p + 3)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[a^2 - b^2, 0] && Lt Q[p, -1] && IntegerQ[2*m]
Leaf count of result is larger than twice the leaf count of optimal. \(1200\) vs. \(2(294)=588\).
Time = 2.46 (sec) , antiderivative size = 1201, normalized size of antiderivative = 4.84
1/6*(b*cos(d*x+c)^2*sin(d*x+c)+a*cos(d*x+c)^2)^(1/2)*(4*EllipticF((b/(a-b) *sin(d*x+c)+a/(a-b))^(1/2),((a-b)/(a+b))^(1/2))*(-b/(a-b)*sin(d*x+c)-b/(a- b))^(1/2)*(-b/(a+b)*sin(d*x+c)+b/(a+b))^(1/2)*(b/(a-b)*sin(d*x+c)+a/(a-b)) ^(1/2)*a^3*b*cos(d*x+c)^2-3*EllipticF((b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2),( (a-b)/(a+b))^(1/2))*(-b/(a-b)*sin(d*x+c)-b/(a-b))^(1/2)*(-b/(a+b)*sin(d*x+ c)+b/(a+b))^(1/2)*(b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2)*a^2*b^2*cos(d*x+c)^2- 4*EllipticF((b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2),((a-b)/(a+b))^(1/2))*(-b/(a -b)*sin(d*x+c)-b/(a-b))^(1/2)*(-b/(a+b)*sin(d*x+c)+b/(a+b))^(1/2)*(b/(a-b) *sin(d*x+c)+a/(a-b))^(1/2)*a*b^3*cos(d*x+c)^2+3*EllipticF((b/(a-b)*sin(d*x +c)+a/(a-b))^(1/2),((a-b)/(a+b))^(1/2))*(-b/(a-b)*sin(d*x+c)-b/(a-b))^(1/2 )*(-b/(a+b)*sin(d*x+c)+b/(a+b))^(1/2)*(b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2)*b ^4*cos(d*x+c)^2-4*(-b/(a-b)*sin(d*x+c)-b/(a-b))^(1/2)*EllipticE((b/(a-b)*s in(d*x+c)+a/(a-b))^(1/2),((a-b)/(a+b))^(1/2))*(-b/(a+b)*sin(d*x+c)+b/(a+b) )^(1/2)*(b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2)*a^4*cos(d*x+c)^2+7*(-b/(a-b)*si n(d*x+c)-b/(a-b))^(1/2)*EllipticE((b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2),((a-b )/(a+b))^(1/2))*(-b/(a+b)*sin(d*x+c)+b/(a+b))^(1/2)*(b/(a-b)*sin(d*x+c)+a/ (a-b))^(1/2)*a^2*b^2*cos(d*x+c)^2-3*(-b/(a-b)*sin(d*x+c)-b/(a-b))^(1/2)*El lipticE((b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2),((a-b)/(a+b))^(1/2))*(-b/(a+b)* sin(d*x+c)+b/(a+b))^(1/2)*(b/(a-b)*sin(d*x+c)+a/(a-b))^(1/2)*b^4*cos(d*x+c )^2+4*a^2*b^2*cos(d*x+c)^4-3*b^4*cos(d*x+c)^4-4*a^3*b*cos(d*x+c)^2*sin(...
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.13 (sec) , antiderivative size = 526, normalized size of antiderivative = 2.12 \[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\frac {\sqrt {2} {\left (8 \, a^{3} - 9 \, a b^{2}\right )} \sqrt {i \, b} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) - 2 i \, a}{3 \, b}\right ) + \sqrt {2} {\left (8 \, a^{3} - 9 \, a b^{2}\right )} \sqrt {-i \, b} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 i \, a}{3 \, b}\right ) + 3 \, \sqrt {2} {\left (4 i \, a^{2} b - 3 i \, b^{3}\right )} \sqrt {i \, b} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) - 2 i \, a}{3 \, b}\right )\right ) + 3 \, \sqrt {2} {\left (-4 i \, a^{2} b + 3 i \, b^{3}\right )} \sqrt {-i \, b} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 i \, a}{3 \, b}\right )\right ) - 6 \, {\left (a b^{2} \cos \left (d x + c\right )^{2} - {\left (2 \, a^{2} b - 2 \, b^{3} + {\left (4 \, a^{2} b - 3 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \sqrt {b \sin \left (d x + c\right ) + a}}{36 \, {\left (a^{2} b - b^{3}\right )} d \cos \left (d x + c\right )^{3}} \]
1/36*(sqrt(2)*(8*a^3 - 9*a*b^2)*sqrt(I*b)*cos(d*x + c)^3*weierstrassPInver se(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*I*a^3 - 9*I*a*b^2)/b^3, 1/3*(3*b*cos (d*x + c) - 3*I*b*sin(d*x + c) - 2*I*a)/b) + sqrt(2)*(8*a^3 - 9*a*b^2)*sqr t(-I*b)*cos(d*x + c)^3*weierstrassPInverse(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27 *(-8*I*a^3 + 9*I*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) + 3*I*b*sin(d*x + c) + 2*I*a)/b) + 3*sqrt(2)*(4*I*a^2*b - 3*I*b^3)*sqrt(I*b)*cos(d*x + c)^3*weier strassZeta(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*I*a^3 - 9*I*a*b^2)/b^3, weie rstrassPInverse(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*I*a^3 - 9*I*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) - 3*I*b*sin(d*x + c) - 2*I*a)/b)) + 3*sqrt(2)*(-4*I *a^2*b + 3*I*b^3)*sqrt(-I*b)*cos(d*x + c)^3*weierstrassZeta(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(-8*I*a^3 + 9*I*a*b^2)/b^3, weierstrassPInverse(-4/3*(4* a^2 - 3*b^2)/b^2, -8/27*(-8*I*a^3 + 9*I*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) + 3*I*b*sin(d*x + c) + 2*I*a)/b)) - 6*(a*b^2*cos(d*x + c)^2 - (2*a^2*b - 2 *b^3 + (4*a^2*b - 3*b^3)*cos(d*x + c)^2)*sin(d*x + c))*sqrt(b*sin(d*x + c) + a))/((a^2*b - b^3)*d*cos(d*x + c)^3)
\[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int \sqrt {a + b \sin {\left (c + d x \right )}} \sec ^{4}{\left (c + d x \right )}\, dx \]
\[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int { \sqrt {b \sin \left (d x + c\right ) + a} \sec \left (d x + c\right )^{4} \,d x } \]
\[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int { \sqrt {b \sin \left (d x + c\right ) + a} \sec \left (d x + c\right )^{4} \,d x } \]
Timed out. \[ \int \sec ^4(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int \frac {\sqrt {a+b\,\sin \left (c+d\,x\right )}}{{\cos \left (c+d\,x\right )}^4} \,d x \]